home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Games / PC-SIG World of Games (CDRM1080710) (1993).iso / ENT / DISK1232.ZIP / AGTNUM.ZOO / agtnum.doc next >
Text File  |  1988-10-22  |  36KB  |  1,218 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.                                     AGTNUM
  16.  
  17.                    The Adventure Game Toolkit Number Manager
  18.  
  19.  
  20.  
  21.  
  22.                                       By
  23.  
  24.                              William D. Martinson
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                                 Distributed by
  36.  
  37.                                    Softworks
  38.                                43064 Via Moraga
  39.                          Mission San Jose, California
  40.                                      94539
  41.  
  42.                                 (415) 659-0533
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  The Adventure Game Toolkit Number Manager (AGTNUM), including all source code,
  49.  object code, and manuals on paper or on disk, is copyright 1988 by William D.
  50.  Martinson.  Portions of this document are borrowed from AGT-DOC.TXT, copyright
  51.  1987 and 1988 by Mark J. Welch and David R. Malmberg.
  52.  
  53.  The Adventure Game Toolkit (AGT), including all source code, object code, and
  54.  manuals on paper or on disk, is copyright 1987 and 1988 by Mark J. Welch and
  55.  David R. Malmberg.  Portions originally copyright 1985 and 1986 by Mark J.
  56.  Welch.
  57.  
  58.  
  59.  
  60.  COPYRIGHT, TRADEMARKS, WARRANTY, AND LICENSE
  61.  
  62.       AGTNUM is provided to users of the Adventure Game Toolkit (AGT), and as
  63.  such is subject to the copyright, warranty, and license conditions of AGT. 
  64.  Specifically, all such conditions that apply to COMPILE.EXE shall be construed
  65.  as applying to AGTNUM.EXE as well.
  66.  
  67.       "Adventure Game Toolkit" and "AGT" are trademarks of Mark J. Welch and
  68.  David R. Malmberg.
  69.  
  70.  
  71.  DISCLAIMER
  72.  
  73.       THE ADVENTURE GAME TOOLKIT NUMBER MANAGER (AGTNUM) COMES WITH NO OTHER
  74.  WARRANTIES OF ANY KIND, INCLUDING WARRANTY OF MERCHANTABILITY OR OF FITNESS
  75.  FOR A PARTICULAR PURPOSE.  AGTNUM IS AVAILABLE AS IS.  IN NO EVENT WILL THE
  76.  AUTHOR OR DISTRIBUTOR BE LIABLE FOR DAMAGES, INCLUDING ANY LOST PROFITS OR
  77.  INCIDENTAL AND CONSEQUENTIAL DAMAGES, EVEN IF THE AUTHOR AND/OR DISTRIBUTOR
  78.  HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  79.  
  80.  
  81.  REGISTRATION
  82.  
  83.       AGTNUM registration is included with all past, present, and future AGT
  84.  registrations, at no additional cost.
  85.  
  86.  
  87.  PRODUCT/TECHNICAL SUPPORT
  88.  
  89.       The author will make every reasonable effort to fix AGTNUM bugs, and help
  90.  registered users by answering technical and other AGTNUM-related questions. 
  91.  This product/technical support for AGTNUM is available to registered AGT users
  92.  (only) in several forms, listed in order of preference:
  93.  
  94.       (1)  By letter to:  William D. Martinson
  95.                           Post Office Box 1606
  96.                           Beaverton, Oregon  97075-1606
  97.  
  98.       (2)  By telephone to Bill Martinson, Monday through Friday from 7:00 PM
  99.            to 9:00 PM (Pacific Coast Time) at (503) 644-1860, subject to my
  100.            availability.  Please respect these hours.
  101.  
  102.       (3)  By leaving a message in the 'Softworks' forum on BIX (the BYTE
  103.            Information Exchange).
  104.  
  105.       (4)  By CompuServe E-Mail to David Malmberg, CompuServe ID 73435,1277.
  106.  
  107.  If you send disks or listings that you wish returned, be sure to enclosed a
  108.  self-addressed, stamped envelope (SASE) with sufficient postage.  If you do
  109.  not enclose a SASE, your material will not be returned.
  110.  
  111.  BIX and CompuServe correspondence will be routed to Bill Martinson through
  112.  Softworks, so option (1) above will likely result in the fastest turnaround.
  113.  
  114.  Softworks does not provide telephone support for AGTNUM.  That's my
  115.  responsibility, so please don't call David or Mark with AGTNUM questions.
  116.  
  117.  
  118.                                        i
  119.  
  120.  
  121.                                TABLE OF CONTENTS
  122.  
  123.  
  124.  COPYRIGHT, TRADEMARKS, WARRANTY, AND LICENSE  . . . . . . . . . . . . . . .  i
  125.  
  126.  REGISTRATION  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  i
  127.  
  128.  PRODUCT/TECHNICAL SUPPORT . . . . . . . . . . . . . . . . . . . . . . . . .  i
  129.  
  130.  PART 1: INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
  131.  
  132.  PART 2: HOW TO USE AGTNUM . . . . . . . . . . . . . . . . . . . . . . . . .  2
  133.       THE .ALL FILE  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  134.       LABELS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  135.       LABEL DEFINITIONS  . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  136.       PRINTING SHORT MESSAGES FROM META-COMMANDS . . . . . . . . . . . . . .  3
  137.       TEXT MACROS  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4
  138.       MACRO NESTING AND RECURSION  . . . . . . . . . . . . . . . . . . . . .  6
  139.       MULTI-LINE MACROS  . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  140.       TITLE AND INSTRUCTIONS TEXT  . . . . . . . . . . . . . . . . . . . . .  7
  141.  
  142.  PART 3: CUSTOMIZING AGTNUM  . . . . . . . . . . . . . . . . . . . . . . . .  8
  143.       CASE SENSITIVITY . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  144.       DELIMITERS AND KEYWORD CHARACTER . . . . . . . . . . . . . . . . . . .  8
  145.       MACRO NESTING  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  146.       ASSUMED FILENAME EXTENSION . . . . . . . . . . . . . . . . . . . . . .  9
  147.       MAKING OPTIONS PERMANENT . . . . . . . . . . . . . . . . . . . . . . .  9
  148.  
  149.  APPENDIX A: EXAMPLES  . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  150.  
  151.  APPENDIX B: KEYWORDS THAT DEFINE LABELS . . . . . . . . . . . . . . . . . . 14
  152.       AGT KEYWORDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  153.       AGTNUM KEYWORDS  . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  154.  
  155.  APPENDIX C: AGTNUM COMMAND-LINE OPTIONS . . . . . . . . . . . . . . . . . . 15
  156.  
  157.  APPENDIX D: AGTNUM ERROR MESSAGES . . . . . . . . . . . . . . . . . . . . . 16
  158.       WARNINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  159.       ERRORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  160.       FATAL ERRORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.                                       ii
  180.  
  181.  
  182.  PART 1: INTRODUCTION
  183.  
  184.  
  185.  AGTNUM is a sort of "preprocessor" for the AGT compiler.  It is intended to
  186.  simplify the creation and maintenance of the .DAT, .CMD, and .MSG files used
  187.  by the COMPILE program.  AGTNUM provides the following benefits to the game
  188.  designer:
  189.  
  190.       (1)  A single source file is used, which ecompasses everything from the
  191.            .DAT, .CMD, .MSG, .TTL, and .INS files.  Corresponding commands and
  192.            messages can be placed together in the file, and they can immedi-
  193.            ately follow the room, noun, or creature they affect.  AGTNUM
  194.            handles the task of creating the necessary files and writing the
  195.            appropriate information to each.
  196.  
  197.       (2)  Items such as rooms, creatures, messages, and variables can be
  198.            automatically numbered, and then referred to with user-defined
  199.            labels.
  200.  
  201.       (3)  Short messages can be printed from within meta-commands without
  202.            explicitly providing a MESSAGE definition.
  203.  
  204.       (4)  Simple text macros make it easy to modify items that appear in many
  205.            locations throughout the file.
  206.  
  207.       (5)  The use of these features makes the game file self-documenting to a
  208.            great extent.
  209.  
  210.  To use the program, just enter
  211.  
  212.       AGTNUM filename
  213.  
  214.  at the DOS prompt.  If the filename has no extension, an extension of ".ALL"
  215.  will be assumed.  (To use a file with no extension, be sure to append a period
  216.  to the filename.)  If no filename is specified, a brief help screen will be
  217.  displayed.
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.                                        1
  241.  
  242.  
  243.  PART 2: HOW TO USE AGTNUM
  244.  
  245.  
  246.  THE .ALL FILE
  247.  
  248.  AGTNUM reads a single file, usually with an extension of .ALL.  This file
  249.  should contain everything that would normally go into the .DAT, .CMD, and .MSG
  250.  files.  AGTNUM then parses the file, creates the .DAT, .CMD, and .MSG files,
  251.  and writes the appropriate game elements to each of those files.
  252.  
  253.  Optionally, the title and instructions text can also be included in the .ALL
  254.  file and AGTNUM will create the .TTL and .INS files.
  255.  
  256.  
  257.  LABELS
  258.  
  259.  The .ALL file looks very much like the files it creates.  The main difference
  260.  is that it uses text labels instead of numbers for rooms, nouns, and the like. 
  261.  The labels are enclosed in delimiters, which are braces { } by default.  (This
  262.  can be changed; refer to Part 3.)  Labels may consist of any ASCII characters
  263.  (even whitespace characters), except the closing delimiter.  For example, the
  264.  following labels are all legal (and unique):
  265.  
  266.       {bridge}
  267.       {the captain's quarters}
  268.       {transporter pad number 6}
  269.       { transporter pad number 6 }
  270.       {!@#$%^&*()}
  271.       {{{{{{}
  272.       {!}
  273.       { }
  274.       {  }
  275.  
  276.  The null label {} is not allowed.  AGTNUM is insensitive to case by default,
  277.  so {bridge} and {BRIDGE} are considered identical.  (This can be changed;
  278.  refer to Part 3.)
  279.  
  280.  When AGTNUM parses the .ALL file, it assigns appropriate numbers to the
  281.  labels.  When the output files are written, the numbers are substituted for
  282.  the labels.  (The .ALL file is not changed by AGTNUM.)
  283.  
  284.  
  285.  LABEL DEFINITIONS
  286.  
  287.  When AGTNUM encounters a label, it must determine what type of item the label
  288.  refers to (room, message, flag, etc.).  For some items, the normal item
  289.  definition gives this information.  Consider this example:
  290.  
  291.       ROOM {sickbay}                            (* {sickbay} is a ROOM label *)
  292.       Sickbay
  293.       EXIT {corridor}
  294.       END_ROOM
  295.       ROOM_DESCR {sickbay}
  296.       This is the sickbay, where the regulars are cured of all their ails and
  297.       the extras meet slow, painful deaths.
  298.       END_ROOM_DESCR
  299.  
  300.  
  301.                                        2
  302.  
  303.  In this case, the word "ROOM" at the beginning of the line tells AGTNUM that
  304.  {sickbay} is a label for a room.  Labels for nouns, creatures, messages, and
  305.  questions are determined in the same way.
  306.  
  307.  Other AGT items, such as flags and variables, have no such definition.  Since
  308.  a label for one of these items may appear practically anywhere in the file,
  309.  AGTNUM requires you to declare the type of item it refers to, to ensure proper
  310.  numbering.  For this purpose, AGTNUM introduces some special keywords:
  311.  
  312.       FLAG {label}
  313.       COUNTER {label}
  314.       VARIABLE {label}
  315.  
  316.  Each of these keywords appears on its own line, anywhere in the file.  They do
  317.  not have any effect on the structure of the game, but simply tell AGTNUM what
  318.  type of item the label refers to.  For example:
  319.  
  320.       FLAG {flashlight lit}
  321.       VARIABLE {energy left}
  322.       ...
  323.       COMMAND ANY
  324.            Present {flashlight}
  325.            FlagON {flashlight lit}
  326.            VariableLT {energy left} 20
  327.       END_COMMAND
  328.       MESSAGE {batteries dying}
  329.       Your batteries will last only #VAR{energy left}# more turns.
  330.       END_MESSAGE
  331.  
  332.  These keywords cause the labels to be defined with the next available number
  333.  for the particular item.  For example, if there were already four other
  334.  variables defined, AGTNUM would assign the value 5 to the label {energy left}
  335.  upon encountering the VARIABLE definition.
  336.  
  337.  
  338.  PRINTING SHORT MESSAGES FROM META-COMMANDS
  339.  
  340.  AGTNUM provides a short-cut for printing simple messages from within meta-
  341.  commands:  simply put the message in quotation marks following the
  342.  PrintMessage token; no label is necessary.  Consider this example:
  343.  
  344.       COMMAND FIRE PHASER
  345.            IsCarrying {phaser}
  346.            VariableEquals {phaser shots} 0
  347.            PrintMessage {phaser empty}
  348.       END_COMMAND
  349.       MESSAGE {phaser empty}
  350.       The phaser is out of energy.
  351.       END_MESSAGE
  352.  
  353.  The message short-cut allows the game designer to abbreviate this command as
  354.  follows:
  355.  
  356.       COMMAND FIRE PHASER
  357.            IsCarrying {phaser}
  358.            VariableEquals {phaser shots} 0
  359.            PrintMessage "The phaser is out of energy."
  360.       END_COMMAND
  361.  
  362.                                        3
  363.  
  364.  
  365.  AGTNUM will translate the quoted text following the PrintMessage token into a
  366.  message number, and create a corresponding message definition in the .MSG
  367.  file.
  368.  
  369.  AGTNUM searches for the quotation marks "from the outside in," so messages
  370.  that require quote marks as part of the text are possible:
  371.  
  372.       PrintMessage "This message has "quotation marks" in it."
  373.       PrintMessage ""Aye, aye, sir.""
  374.  
  375.  The first and last quotes are removed from the message; all others are left
  376.  intact.  (If you find these "nested" quotes confusing or undesirable, you can
  377.  change the short-cut message delimiter characters; refer to Part 3.)
  378.  
  379.  If no closing quote is found, the message is assumed to extend to the end of
  380.  the line.  Thus, the following message is perfectly legal:
  381.  
  382.       PrintMessage "You can't eat the rock.
  383.  
  384.  Of course, if the message itself contains quote marks, then a closing message
  385.  delimiter must be supplied to mark the end of the message--otherwise the last
  386.  quote mark would signal the end of the text.  For example:
  387.  
  388.       PrintMessage "This message has "embedded" quotes.
  389.  
  390.  Without a closing quote, this message would be printed as follows:
  391.  
  392.       This message has "embedded
  393.  
  394.  and AGTNUM would assume the remaining text on the line was a comment.
  395.  
  396.  Naturally, the short-cut message style is not appropriate for multi-line
  397.  messages, or messages which can be printed from more than one meta-command. 
  398.  For short, specialized messages, however, this style can eliminate a lot of
  399.  typing and reduce the size of the .ALL file.
  400.  
  401.  
  402.  TEXT MACROS
  403.  
  404.  A text macro is simply a special kind of label that can be defined as any text
  405.  string the game designer chooses.  AGTNUM provides a special keyword for
  406.  defining macros:
  407.  
  408.       #DEFINE {label} label definition
  409.  
  410.  This keyword causes the label to be defined as all text after the label to the
  411.  end of the line (not including the first character after the label, which is
  412.  normally a blank).  This keyword is useful for defining macros for "constants"
  413.  used throughout the game file:
  414.  
  415.       rem macros for special "rooms"
  416.       #DEFINE {void} 0
  417.       #DEFINE {carried} 1
  418.       #DEFINE {worn} 1000
  419.  
  420.  
  421.  
  422.  
  423.                                        4
  424.  
  425.       rem macros for the directions used with ChangePassageway
  426.       #DEFINE {North} 1
  427.       #DEFINE {South} 2
  428.       #DEFINE {East} 3
  429.       #DEFINE {West} 4
  430.       #DEFINE {NorthEast} 5
  431.       #DEFINE {NorthWest} 6
  432.       #DEFINE {SouthEast} 7
  433.       #DEFINE {SouthWest} 8
  434.       #DEFINE {Up} 9
  435.       #DEFINE {Down} 10
  436.       #DEFINE {Enter} 11
  437.       #DEFINE {Exit} 12
  438.  
  439.  It's sometimes handy to use a macro for something you may want to change, so
  440.  you don't have to track down all the occurrences of the item.  For example:
  441.  
  442.       VARIABLE {health}
  443.       #DEFINE {max health} 100
  444.       #DEFINE {rest delay} 5
  445.       #DEFINE {rest benefit} 20
  446.       ...
  447.       COMMAND REST
  448.            TimePasses
  449.            Delay {rest delay}
  450.            PrintMessage "Having rested for a while, you now feel much better."
  451.            AddToVariable {health} {rest benefit}
  452.            VariableGT {health} {max health}
  453.            SetVariableTo {health} {max health}
  454.            DoneWithTurn
  455.       END_COMMAND
  456.  
  457.  This allows the game designer to quickly change, say, the maximum health the
  458.  player can have, no matter how many times that value is referred to in the
  459.  file.  Here's another example, adapted from the Colossal Cave Adventure:
  460.  
  461.       #DEFINE {magic word} XYZZY
  462.       ...
  463.       Dummy_Verb17 {magic word}
  464.       ...
  465.       ROOM_DESCR {debris room}
  466.       You are in a debris room filled with stuff washed in from the surface.  A
  467.       low wide passage with cobbles becomes plugged with mud and debris here,
  468.       but an awkward canyon leads upward and west.  A note on the wall says:
  469.            Magic Word "{magic word}"
  470.       END_ROOM_DESCR
  471.       ...
  472.       COMMAND {magic word}
  473.            FlagOFF {cave closed}
  474.            AtLocation {debris room}
  475.            PrintMessage {transported}
  476.            GoToRoom {inside building}
  477.            DoneWithTurn
  478.       END_COMMAND
  479.       ...
  480.  
  481.  
  482.  
  483.  
  484.                                        5
  485.  
  486.       COMMAND {magic word}
  487.            FlagOFF {cave closed}
  488.            AtLocation {inside building}
  489.            PrintMessage {transported}
  490.            GoToRoom {debris room}
  491.            DoneWithTurn
  492.       END_COMMAND
  493.       ...
  494.       COMMAND {magic word}
  495.            PrintMessage "A voice booms out, "That word doesn't work here!""
  496.            DoneWithTurn
  497.       END_COMMAND
  498.  
  499.  AGTNUM allows up to 500 macros in a game file.
  500.  
  501.  
  502.  MACRO NESTING AND RECURSION
  503.  
  504.  By default, macros are "nestable", meaning that they can include references to
  505.  other labels.  When a macro is expanded, the resulting text is then scanned
  506.  for additional macros and labels.  (This can be changed; refer to Part 3.) 
  507.  The following example makes use of macro nesting:
  508.  
  509.       NOUN {burning torch}
  510.       ...
  511.       NOUN {unlit torch}
  512.       ...
  513.       #DEFINE {extinguish} SwapLocations {burning torch} {unlit torch}
  514.       ...
  515.       COMMAND ANY
  516.            FlagON {wind blowing}
  517.            Chance 10
  518.            PrintMessage "The wind blows out your torch."
  519.            {extinguish}
  520.       END_COMMAND
  521.  
  522.  The danger with nestable labels is this:  if a macro refers to itself, either
  523.  directly or indirectly, then the macro's final value cannot be determined. 
  524.  AGTNUM would spend eternity trying to expand the macro, forever ending up with
  525.  another macro.  For example:
  526.  
  527.       #DEFINE {yoyo} xx {yoyo} xx
  528.  
  529.  AGTNUM will define a macro called {yoyo} with the text "xx {yoyo} xx".  When
  530.  the macro is expanded, a new macro (also called {yoyo}) is discovered which
  531.  must itself expanded, ad infinitum.  Here's another example, using indirect
  532.  recursion:
  533.  
  534.       #DEFINE {tweedle dee} {tweedle dum}
  535.       #DEFINE {tweedle dum} {tweedle dee}
  536.  
  537.  To handle recursive macros, AGTNUM will display an error message if more than
  538.  30 macro expansions are performed on a single line of the file.
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.                                        6
  546.  
  547.  MULTI-LINE MACROS
  548.  
  549.  To write a macro that expands to multiple lines of text, use the two
  550.  characters '\n' to represent the newline, or carriage return.  For example, if
  551.  a number of meta-commands depend on the presence of the sword, axe, or mace,
  552.  the following macro could be useful:
  553.  
  554.       #DEFINE {armed} Present {sword}\nOR\nPresent {axe}\nOR\nPresent {mace}
  555.  
  556.  This macro could be used in the meta-commands as follows:
  557.  
  558.       COMMAND BREAK LOCK
  559.            {armed}
  560.            InRoom {oak door}
  561.            ...
  562.       END_COMMAND
  563.  
  564.  
  565.  TITLE AND INSTRUCTIONS TEXT
  566.  
  567.  To identify the text for the game title and instructions, AGTNUM provides some
  568.  additional keywords:
  569.  
  570.       TITLE
  571.       The game title goes here, in the .TTL file format.
  572.       END_TITLE
  573.  
  574.       INSTRUCTIONS
  575.       The game instructions go here, in the .INS file format.
  576.       END_INSTRUCTIONS
  577.  
  578.  When one of these keywords is found, AGTNUM creates the appropriate file and
  579.  writes the description (without the keywords) to the file.  If one or both of
  580.  these are omitted, AGTNUM will ignore the .TTL and/or .INS file, to allow the
  581.  game designer to maintain these files manually if desired.
  582.  
  583.  Macros and labels may be used in the title and instructions text.
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.                                        7
  607.  
  608.  
  609.  PART 3: CUSTOMIZING AGTNUM
  610.  
  611.  
  612.  You can customize AGTNUM's operation through the use of several command-line
  613.  options (letters preceded by a slash [/] or dash [-]).  The options should
  614.  follow the filename on the command line, and may appear in any order.  If
  615.  conflicting options are given, the last one given will override the earlier
  616.  ones.
  617.  
  618.  
  619.  CASE SENSITIVITY
  620.  
  621.  AGTNUM is case insensitive by default, which means that uppercase and lower-
  622.  case letters are treated as identical.  For example, the labels {sickbay} and
  623.  {SICKBAY} are considered to be the same label.  To make AGTNUM case sensitive,
  624.  specify /C on the command line.  /I will override this and make AGTNUM case
  625.  insensitive.
  626.  
  627.  When AGTNUM is case sensitive, keywords such as ROOM and VARIABLE *must* be
  628.  typed in all capital letters in the .ALL file, or they will not be recognized.
  629.  
  630.  
  631.  DELIMITERS AND KEYWORD CHARACTER
  632.  
  633.  The default delimiters for labels are the braces ({ and }), the delimiters for
  634.  short-cut messages are the quote marks ("), and the lead-in character for the
  635.  AGTNUM keyword DEFINE is the number sign (#).
  636.  
  637.  To change the label delimiters, specify /Loc (where 'o' and 'c' are the new
  638.  opening and closing delimiter characters).  If you leave off the second
  639.  character, the first one will be used for both; for example:
  640.  
  641.       AGTNUM MYGAME /L!
  642.  
  643.  tells AGTNUM that the labels in MYGAME.ALL are of the form !label!.
  644.  
  645.  To change the message delimiters, specify /Moc (where 'o' and 'c' are the new
  646.  opening and closing delimiter characters).  For example:
  647.  
  648.       AGTNUM MYGAME /M`'
  649.  
  650.  tells AGTNUM that the short-cut messages in MYGAME.ALL are of the form
  651.  PrintMessage `message'.  As with the /L option, leaving off the second
  652.  character causes the first one to be used for both delimiters.
  653.  
  654.  To change the lead-in character for the #DEFINE keyword, specify /Kc, where
  655.  'c' is the new lead-in character.  For example:
  656.  
  657.       AGTNUM MYGAME /K%
  658.  
  659.  tells AGTNUM that macro definitions in MYGAME.ALL begin with %DEFINE.
  660.  
  661.  If you give one of these options without any characters after it, the current
  662.  character(s) will be displayed.  For example:
  663.  
  664.       AGTNUM MYGAME /K /L /M
  665.  
  666.  
  667.                                        8
  668.  
  669.  will yield the response:
  670.  
  671.       Keyword character is #
  672.       Label delimiters are { and }
  673.       Messg delimiters are " and "
  674.  
  675.  To use the DOS meta-characters <, >, and | with these options, enclose the
  676.  entire option string in quotes.  For example:
  677.  
  678.       AGTNUM MYGAME "/L<>" "/M|"
  679.  
  680.  
  681.  MACRO NESTING
  682.  
  683.  Macros, by default, are "nestable", meaning that they can refer to other
  684.  labels.  To make them static, or not nestable, specify /S.  To make then
  685.  nestable again, specify /N.  Static macros are not re-scanned for new labels
  686.  after they are expanded.  Making macros static allows error-free processing of
  687.  macros such as
  688.  
  689.       #DEFINE {left brace} {
  690.       #DEFINE {legal null} {}
  691.  
  692.  but prevents the following definition from working properly:
  693.  
  694.       #DEFINE {extinguish} SwapLocations {burning torch} {unlit torch}
  695.  
  696.  
  697.  ASSUMED FILENAME EXTENSION
  698.  
  699.  The default assumed filename extension is .ALL.  This extension is appended to
  700.  any filename that lacks an extension.  To change the extension, specify /Xext,
  701.  where 'ext' is the new extension (do not include the period).  For example:
  702.  
  703.       AGTNUM MYGAME /XAGT
  704.  
  705.  Of course, this example is a kind of silly.  It would be easier to type
  706.  
  707.       AGTNUM MYGAME.AGT
  708.  
  709.  since AGTNUM allows an extension as part of the filename.  The primary use of
  710.  /X is in the environment variable, to change the assumed extension on a more-
  711.  or-less permanent basis (see below).
  712.  
  713.  
  714.  MAKING OPTIONS PERMANENT
  715.  
  716.  Since it would be inconvenient to have to specify these options each time you
  717.  use AGTNUM, a DOS environment variable is supported.  Put a line of the form
  718.  
  719.       SET AGTNUM= options
  720.  
  721.  in your AUTOEXEC.BAT file and reboot your computer, and AGTNUM will auto-
  722.  matically use the new options.  Options given on the command line override the
  723.  options in the environment variable.  For example, if your AUTOEXEC.BAT file
  724.  contains the line
  725.  
  726.       SET AGTNUM="/L<>"
  727.  
  728.                                        9
  729.  
  730.  
  731.  AGTNUM will expect labels to be enclosed in angle brackets from now on. 
  732.  However, if you type
  733.  
  734.       AGTNUM MYGAME /L{}
  735.  
  736.  AGTNUM will temporarily expect labels to be enclosed in braces in MYGAME.ALL.
  737.  
  738.  If you later decide to edit your AUTOEXEC.BAT file to change the options
  739.  again, be sure to reboot your computer to put the new options in place.
  740.  
  741.  You can also use this variable to specify a default filename.  If you tend to
  742.  work on a single game file at a time, you can include the filename in the
  743.  option string and have AGTNUM process that file if no other file is specified
  744.  on the command line.  For example, if your AUTOEXEC.BAT file has the line
  745.  
  746.       SET AGTNUM= MYGAME /L[]
  747.  
  748.  then you can process MYGAME.ALL, looking for labels in square brackets, by
  749.  simply entering the command
  750.  
  751.       AGTNUM
  752.  
  753.  Naturally, you can override this default filename by specifying one on the
  754.  command line.
  755.  
  756.  See your DOS manual for more details on environment variables and the SET
  757.  command.
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                       10
  790.  
  791.  
  792.  APPENDIX A: EXAMPLES
  793.  
  794.  
  795.  Here is a short excerpt from a sample .ALL file:
  796.  
  797.       ROOM {bridge}
  798.       Bridge
  799.       SOUTH {turbolift}
  800.       END_ROOM
  801.       ROOM_DESCR {bridge}
  802.       You are on the bridge of the Enterprise.
  803.       END_ROOM_DESCR
  804.  
  805.       NOUN {phaser}
  806.       Phaser
  807.       Hand
  808.       There is a hand phaser here.
  809.       LOCATION {bridge}
  810.       CAN_SHOOT
  811.       NUM_SHOTS 999
  812.       SIZE 2
  813.       END_NOUN
  814.       NOUN_DESCR {phaser}
  815.       This is a standard box-shaped Phaser I.  While not as powerful as the
  816.       pistol-shaped Phaser II, it is considerably more compact and thus easily
  817.       concealed.
  818.       END_NOUN_DESCR
  819.  
  820.       COMMAND FIRE PHASER
  821.            AtLocation {bridge}
  822.            IsCarrying {phaser}
  823.            PrintMessage {destroy bridge}
  824.            EndGame
  825.       END_COMMAND
  826.       MESSAGE {destroy bridge}
  827.       You fire the phaser.  The bridge wall is ruptured, and the area rapidly
  828.       depressurizes.  You are killed, along with the rest of the bridge crew.
  829.       END_MESSAGE
  830.  
  831.       ROOM {turbolift}
  832.       Turbolift
  833.       NORTH {bridge}
  834.       END_ROOM
  835.       ROOM_DESCR {turbolift}
  836.       You are in the turbolift.
  837.       END_ROOM_DESCR
  838.  
  839.  
  840.  When AGTNUM parses this file, it will assign numbers to the labels as follows:
  841.  
  842.       {bridge}           2
  843.       {turbolift}        3
  844.       {phaser}         200
  845.       {destroy bridge}   1
  846.  
  847.  
  848.  
  849.  
  850.                                       11
  851.  
  852.  Here's the flashlight example from AGT-DOC.TXT, modified to exploit some
  853.  AGTNUM features.  Notice that the file is still very readable, even though
  854.  many of the original comments have been deleted.
  855.  
  856.       FLAG {game started}     is OFF at start of game and ON otherwise
  857.       FLAG {flashlight lit}   is OFF if the flashlight is OFF & ON if it is ON
  858.       VARIABLE {batt life} will count down the life of the battery
  859.  
  860.       #DEFINE {initial battery charge} 100
  861.       #DEFINE {battery warning level} 20
  862.  
  863.       ; Noun {off flashlight} is FlashLight in OFF condition
  864.       ; Noun {on flashlight} is FlashLight in ON condition
  865.       ; Noun {dead flashlight} is FlashLight in DEAD condition
  866.  
  867.       COMMAND ANY
  868.         FlagOFF {game started} (* First game turn -- initialize Battery life *)
  869.         SetVariableTo {batt life} {initial battery charge}
  870.         TurnFlagON {game started} (* Initialization process is now over *)
  871.       END_COMMAND
  872.  
  873.       COMMAND ANY
  874.         FlagON {flashlight lit}
  875.         SubtractFromVariable {batt life} 1
  876.       END_COMMAND
  877.  
  878.       COMMAND ANY
  879.         FlagON {flashlight lit}
  880.         Present {on flashlight} (* No warning unless Flashlight here *)
  881.         VariableGT {batt life} 0
  882.         NOT VariableGT {batt life} {battery warning level}
  883.         PrintMessage "Flashlight will last only #VAR{batt life}# more turns!"
  884.         VariableEquals {batt life} {battery warning level}
  885.         PrintMessage "You had better save your batteries!"
  886.       END_COMMAND
  887.  
  888.       COMMAND ANY
  889.         FlagON {flashlight lit}
  890.         VariableEquals {batt life} 0
  891.         TurnFlagOFF {flashlight lit} (* Turn it off for the last time! *)
  892.         SwapLocations {on flashlight} {dead flashlight}
  893.         Present {dead flashlight} (* No message unless Flashlight here *)
  894.         PrintMessage "The Flashlight's batteries are dead!!"
  895.       END_COMMAND
  896.  
  897.       COMMAND LIGHT FLASHLIGHT
  898.         Present {off flashlight}
  899.         TurnFlagON {flashlight lit}
  900.         SwapLocations {off flashlight} {on flashlight}
  901.         PrintMessage "The flashlight is ON and shining brightly!"
  902.         DoneWithTurn
  903.       END_COMMAND
  904.  
  905.       COMMAND LIGHT FLASHLIGHT
  906.         Present {on flashlight}
  907.         PrintMessage "The flashlight is already ON, dummy!"
  908.         DoneWithTurn
  909.       END_COMMAND
  910.  
  911.                                       12
  912.  
  913.  
  914.       COMMAND LIGHT FLASHLIGHT
  915.         Present {dead flashlight}
  916.         PrintMessage "Sorry, but the batteries are dead!"
  917.         DoneWithTurn
  918.       END_COMMAND
  919.  
  920.       COMMAND EXTINGUISH FLASHLIGHT
  921.         Present {on flashlight}
  922.         TurnFlagOFF {flashlight lit}
  923.         SwapLocations {off flashlight} {on flashlight}
  924.         PrintMessage "The flashlight is now off!"
  925.         DoneWithTurn
  926.       END_COMMAND
  927.  
  928.       COMMAND EXTINGUISH FLASHLIGHT
  929.         Present {off flashlight}
  930.           OR
  931.         Present {dead flashlight}
  932.         PrintMessage "The flashlight is already OFF!"
  933.         DoneWithTurn
  934.       END_COMMAND
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.                                       13
  973.  
  974.  
  975.  APPENDIX B: KEYWORDS THAT DEFINE LABELS
  976.  
  977.  
  978.  The value of each label is the next number in sequence for the kind of item
  979.  the label refers to.  For macros (#DEFINEd labels), the label's value is
  980.  whatever the game designer chooses.
  981.  
  982.  
  983.  AGT KEYWORDS
  984.  
  985.       ROOM      {label}
  986.       NOUN      {label}
  987.       CREATURE  {label}
  988.       MESSAGE   {label}
  989.       QUESTION  {label}
  990.  
  991.  
  992.  AGTNUM KEYWORDS
  993.  
  994.       FLAG      {label}
  995.       COUNTER   {label}
  996.       VARIABLE  {label}
  997.       #DEFINE   {label} label definition (AGTNUM allows 500 #DEFINEs)
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.                                       14
  1034.  
  1035.  
  1036.  APPENDIX C: AGTNUM COMMAND-LINE OPTIONS
  1037.  
  1038.  
  1039.       /C        Make AGTNUM case sensitive.
  1040.  
  1041.       /I        Make AGTNUM case insensitive.
  1042.  
  1043.       /Kc       Make 'c' the new keyword lead-in character.
  1044.  
  1045.       /Loc      Make 'o' and 'c' the new opening and closing label delimiters. 
  1046.                 If 'c' is omitted, 'o' will be used for both delimiters.
  1047.  
  1048.       /Moc      Make 'o' and 'c' the new opening and closing short-cut message
  1049.                 delimiters.  If 'c' is omitted, 'o' will be used for both
  1050.                 delimiters.
  1051.  
  1052.       /N        Make macros nestable.
  1053.  
  1054.       /S        Make macros static (not nestable).
  1055.  
  1056.       /Xext     Make 'ext' the new assumed filename extension.
  1057.  
  1058.       /?        Display a help screen.
  1059.  
  1060.  Options may be preceded by a dash (-) instead of a slash (/).
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.                                       15
  1095.  
  1096.  
  1097.  APPENDIX D: AGTNUM ERROR MESSAGES
  1098.  
  1099.  
  1100.  Errors reported by AGTNUM fall into three categories:  warnings, errors, and
  1101.  fatal errors.
  1102.  
  1103.  Warnings are conditions which should be noted by the game designer.  They may
  1104.  be indicative of errors, but the file can be processed normally in spite of
  1105.  them.  It is entirely possible for a game file to have warnings and still
  1106.  operate as the game designer intended.
  1107.  
  1108.  Errors generally result from mistyped or incorrect labels, and probably
  1109.  indicate problems that will cause the game to operate incorrectly.  AGTNUM
  1110.  continues to process the file in spite of the errors, for two reasons:
  1111.  
  1112.       (1)  There may be additional warnings and errors in the file, and it's
  1113.            useful to display as many of them as possible to allow the game
  1114.            designer to correct more than one problem at a time.
  1115.  
  1116.       (2)  The "error" may in fact be legitimate.  For example, the game
  1117.            designer may wish to have one or more braces as part of some game
  1118.            text.  AGTNUM would report an undefined or null label, or a missing
  1119.            closing delimiter, when no error actually existed.
  1120.  
  1121.  Fatal errors are serious conditions that prevent AGTNUM from continuing,
  1122.  either because of an internal problem or because it's very likely the output
  1123.  files will not make it through the COMPILE program.
  1124.  
  1125.  
  1126.  WARNINGS
  1127.  
  1128.  Label(s) defined but not referenced
  1129.  
  1130.       One or more labels were defined but not used elsewhere in the file. 
  1131.       These are sometimes the result of typographical errors, and often will
  1132.       "match up" with other error messages.  For example, if a label is
  1133.       referred to only once and either the definition or the reference is
  1134.       mistyped, the definition will be reported under this warning and the
  1135.       reference will generate an "Undefined label" error.
  1136.  
  1137.  
  1138.  ERRORS
  1139.  
  1140.  No closing delim
  1141.  
  1142.       An opening label delimiter was found without a subsequent closing
  1143.       delimiter.  Probably a typo.
  1144.  
  1145.  Null label
  1146.  
  1147.       The null label {} was encountered.  If you actually need these two
  1148.       characters in a message, and if macro nesting is disabled, try using a
  1149.       macro (e.g., #DEFINE {braces} {}) to eliminate this "error" message.
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.                                       16
  1156.  
  1157.  Label not defined
  1158.  
  1159.       A label is being referred to but has not been defined anywhere in the
  1160.       file.  If the label represents a flag, counter, or variable, you need a
  1161.       FLAG, COUNTER, or VARIABLE line in the file.  This is also often the
  1162.       result of a typo.
  1163.  
  1164.  Label redefined
  1165.  
  1166.       A label definition has been found, and the label is already defined. 
  1167.       This could be a typo, or you could have (for example) both a ROOM and a
  1168.       NOUN called {fountain}.  Change one of the label names.
  1169.  
  1170.  No #define text
  1171.  
  1172.       A line beginning with the keyword #DEFINE contains a label but no text to
  1173.       define the label with.
  1174.  
  1175.  Macro recursion
  1176.  
  1177.       The limit of 30 macro expansions per line was exceeded, probably because
  1178.       a macro refers to itself (either directly or indirectly).
  1179.  
  1180.  Macro too long
  1181.  
  1182.       Expansion of a macro would cause the line to be too long for AGTNUM to
  1183.       handle.  This error can also be caused by macro recursion, if the maximum
  1184.       line length is exceeded before 30 expansions have been performed.
  1185.  
  1186.  
  1187.  FATAL ERRORS
  1188.  
  1189.  Line too long
  1190.  
  1191.       A line in the .ALL file is longer than 254 characters.  If the line
  1192.       contains a multi-line short-cut message, either shorten the message or
  1193.       don't use the short-cut format.
  1194.  
  1195.  Too many rooms (nouns/creatures/messages/questions/flags/counters/variables)
  1196.  
  1197.       Your game file has more of the item in question than AGT allows.  You
  1198.       will probably need to restructure the game.
  1199.  
  1200.  Too many #defines
  1201.  
  1202.       Your game file has more #DEFINEd labels than AGTNUM allows.  You will
  1203.       probably need to convert some of your label references into regular text.
  1204.  
  1205.  Out of memory
  1206.  
  1207.       AGTNUM has run out of memory while trying to define or expand a label. 
  1208.       If you are running AGTNUM in a multi-tasking environment, or with a lot
  1209.       of resident utilities, you may need to remove some processes or utilities
  1210.       to free additional memory.
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.                                       17
  1217.  
  1218.